package bean.caculate;

import bean.actor.BaseActor;

public class CalculateContext {
    private ReportBuzzStudent reportBuzzStudent = new ReportBuzzStudent();
    private ReportFizzStudent reportFizzStudent = new ReportFizzStudent();
    private ReportWhizzStudent reportWhizzStudent = new ReportWhizzStudent();
    private ReportBuzzWhizzStudent reportBuzzWhizzStudent = new ReportBuzzWhizzStudent();
    private ReportFizzBuzzStudent reportFizzBuzzStudent = new ReportFizzBuzzStudent();
    private ReportFizzWhizzStudent reportFizzWhizzStudent = new ReportFizzWhizzStudent();
    private ReportFizzBuzzWhizzStudent reportFizzBuzzWhizzStudent = new ReportFizzBuzzWhizzStudent();
    private SpecialReportFizzStudent specialReportFizzStudent = new SpecialReportFizzStudent();

    public CalculateContext() {
        specialReportFizzStudent.setNext(reportFizzBuzzWhizzStudent);
        reportFizzBuzzWhizzStudent.setNext(reportBuzzWhizzStudent);
        reportBuzzWhizzStudent.setNext(reportFizzBuzzStudent);
        reportFizzBuzzStudent.setNext(reportFizzWhizzStudent);
        reportFizzWhizzStudent.setNext(reportFizzStudent);
        reportFizzStudent.setNext(reportBuzzStudent);
        reportBuzzStudent.setNext(reportWhizzStudent);
    }

    public BaseActor caculate(BaseActor baseActor) {
        return specialReportFizzStudent.process(baseActor);
    }
}
